<?php
class CSV {
    /**
     * Parse a given string that contains lines of data and return only the 
     * lines that start with the given prefix.
     */
    public static function read($fileContents,$prefix) {
	$lines = explode("\n", $fileContents);
	$result = array();
	for ($counter = 0; $counter < count($lines);$counter++)
	{
            $item = $lines[$counter];
            if (0===strpos($item, $prefix))
            {
                $result[] = explode(',',$lines[$counter]);
            }
	}
	return $result;
    }
}
?>